using Vin.Extension.Win32.Command.Workflow;
using Vin.Tool.AspNetCore.Singleton;

namespace Vin.Extension.Win32.Command.Node;

public class NodeContext : INodeContext
{
    public NodeGroup NodeInput { get; }
    public NodeExecuteData CurrentNodeExecuteData { get; }
    public int Port { get; set; }

    public NodeContext(NodeGroup nodeInput, NodeExecuteData currentNodeExecuteData)
    {
        NodeInput = nodeInput;
        CurrentNodeExecuteData = currentNodeExecuteData;
        var workflowData = VinApp.GetRequiredServiceByHttpContext<IWorkflowContext>();
        workflowData.AddNodeContext(currentNodeExecuteData.NodeData.Id, this);
    }
}